# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=retroarch
pkgver=1.8.9
pkgrel=0
arch="all !mips !mips64"
url="https://retroarch.com"
pkgdesc="Reference frontend for the libretro API"
license="GPL-2.0-only"
depends="retroarch-assets retroarch-joypad-autoconfig libretro-core-info libretro-database"
makedepends="linux-headers mesa-dev qt5-qtbase-dev wayland-dev wayland-protocols zlib-dev alsa-lib-dev pulseaudio-dev sdl2-dev flac-dev mbedtls-dev libusb-dev ffmpeg-dev libxkbcommon-dev eudev-dev vulkan-loader-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/libretro/retroarch/archive/v$pkgver.tar.gz
	config.patch"
subpackages="$pkgname-doc"
builddir="$srcdir/RetroArch-$pkgver"
options="!check" # No tests

build() {
	CFLAGS="$CFLAGS -I/usr/include/directfb"
	./configure \
		--prefix=/usr \
		--enable-dynamic \
		--disable-vg \
		--disable-discord \
		--disable-builtinminiupnpc \
		--disable-builtinmbedtls \
		--disable-builtinflac \
		--disable-builtinzlib
	make
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="7544437b5e913db2397442fac53cd2a659f06569063f87600040b18d9581055ee8eb8c06316669ef98a07692449b26d07c1b1633be6c4e57b3fc64299a38d459  retroarch-1.8.9.tar.gz
9d4ba0e1aca8e19baf6f19afbb3b0f7aa6f359870e84dd5f0fcb46b5716dbc23637cb342414e35ad635a6333e4af072cb88e7357ea42ee5c88a15b3fc6f5c2e2  config.patch"
